@echo off
set ProgramFilesPathForGac=%ProgramFiles%
if exist "%ProgramFilesPathForGac%\Microsoft.NET\SDK\v2.0\bin\gacutil.exe" (
  set gac="%ProgramFilesPathForGac%\Microsoft.NET\SDK\v2.0\bin\gacutil.exe"
) ELSE (
  if exist "%ProgramFilesPathForGac%\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" (
    set gac="%ProgramFilesPathForGac%\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe"
  ) else (
    set gac="%ProgramFilesPathForGac%\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe"
  )
)
echo gac = %gac%


:unregister

ECHO.Unregister and delete previously installed files (which may fail if nothing is registered)
ECHO.
%gac% /u "Google.GData.Client"
%gac% /u "Google.GData.Extensions"
%gac% /u "Google.GData.Photos"
%gac% /u "FlickrNet"
if "%1"=="/u" goto exit
echo.

ECHO.Register the DLLs with the global assembly cache
%gac% /if ".\PicasaAPI\lib\Google.GData.Client.dll"
%gac% /if ".\PicasaAPI\lib\Google.GData.Extensions.dll"
%gac% /if ".\PicasaAPI\lib\Google.GData.Photos.dll"
%gac% /if ".\FlickrAPI\lib\FlickrNet.dll"
ECHO.

:exit